package com.example.hystrixDemo.rxjava;/**
 * @Deacription TODO
 * @Author baohuajie
 * @Date 2020/12/15 14:45
 * @Version 1.0
 **/

import rx.Observable;
import rx.Observer;
import rx.functions.Func1;

/**
 * @Deacription TODO
 * @Author baohuajie
 * @Date 2020/12/15 14:45
 * @Version 1.0
 **/
public class Main4 {
    public static void main(String[] args) {
//        Observable observable = Observable.create()

        Observable.just("1", "2", "3")
                .map(new Func1<String, Integer>() {
                    @Override
                    public Integer call(String s) {
                        return Integer.parseInt(s);
                    }
                }).subscribe(new Observer<Integer>() {
            @Override
            public void onCompleted() {
            }

            @Override
            public void onError(Throwable e) {

            }

            @Override
            public void onNext(Integer integer) {
                System.out.println( 1==integer);
            }
        });
    }
}
